package com.ruoyi.labdata.service;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public abstract class EndTaskListener<T> {
	private Class<T> entityClass;

	@SuppressWarnings("unchecked")
	protected EndTaskListener() {
		Type type = getClass().getGenericSuperclass();
		Type trueType = ((ParameterizedType) type).getActualTypeArguments()[0];
		this.entityClass = (Class<T>) trueType;
	}
	
	public Class<T> getType(){
		return entityClass;
	}
	
	public abstract int doTask(Long instanceId);
}
